package java56_6;

public class ScoresStat {

	public static void main(String[] args) {
		// 求所有人中的最高分
		int[][] s = new int[5][5];
		for (int i = 0; i < s.length; i++)
			for (int j = 0; j < s[i].length; j++)
				s[i][j] = (int) (Math.random() * 100);

		for (int i = 0; i < s.length; i++) {
			for (int j = 0; j < s[i].length; j++)
				System.out.print(s[i][j] + " ");
			System.out.println();
		}
		// 计算各自班级的总分
		int total = 0;
		for (int i = 0; i < s.length; i++) {
			total = 0;
			for (int j = 0; j < s[i].length; j++)
				total += s[i][j];
			System.out.println((i + 1) + "班的总分是" + total + "分");
		}
		int max = s[0][0];
		for (int i = 0; i < s.length; i++) {
			for (int j = 0; j < s[i].length; j++) {
				if (max < s[i][j])
					max = s[i][j];
			}
		}
		System.out.println("最大是" + max);
	}

}
